<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=latin1">
        <link rel="stylesheet" type="text/css" href="../padrao.css" />
        <link rel="stylesheet" href="../jQuery/lista.css" type="text/css" media="all" />
        <script type="text/javascript" src="../jQuery/jquery-1.2.1.pack.js"></script>
        <script type="text/javascript" src="../jQuery/busca.js"></script>

        <title> Template </title>

        <?php
        include '../infobox.php';
        include '../verifica_usuario.php';
        include '../functions.php';
        include '../functions_office.php';
        include '../menu.php';
        ?>

    </head>
    <body>
        <div class="conteudo">

            <?php
            $func_login = $_POST[func_login];
            $func_senha = $_POST[func_senha];
            $func_nome = $_POST[func_nome];
            $func_cargo = $_POST[func_cargo];
            $func_area = $_POST[func_area];
            $aterro = $_POST[aterro_nome];

            if ($aterro == "NULL") {
                echo "$aterro = NULL";

                include("mysqlconfig.inc");
                $query = "insert into FUNCIONARIOS values('$func_login','$func_senha','$func_nome','$func_cargo','$func_area',NULL); ";
                $grava = mysql_query($query);
                $num_linha = mysql_affected_rows();
                if ($num_linha == 1) {
                    header("Location: pesquisa_funcionarios.php");
                    mysql_close($con);
                }
                mysql_close($con);
            } else {

                echo "$aterro";

                include("mysqlconfig.inc");
                $query = "insert into FUNCIONARIOS values('$func_login','$func_senha','$func_nome','$func_cargo','$func_area','$aterro'); ";
                $grava = mysql_query($query);
                $num_linha = mysql_affected_rows();
                if ($num_linha == 1) {
                    header("Location: pesquisa_funcionarios.php");
                    mysql_close($con);
                }
                mysql_close($con);
            }
            ?>
        </div>
    </body>
</html>
